<template>
	<div class="visualizing-container-head">
		<div class="visualizing-container-head-left">
			<div class="visualizing-container-head-left-text">
				<div class="visualizing-container-head-left-text-box">{{ state.time.txt }}</div>
			</div>
		</div>
		<div class="visualizing-container-head-center">
			<div class="visualizing-container-head-center-box">
				<div class="visualizing-container-head-center-maintitle">智行教育游泳场馆</div>
				<div class="visualizing-container-head-center-subtitle">智能监控</div>
			</div>
		</div>
		<div class="visualizing-container-head-right">
			<div class="visualizing-container-head-right-text">
				<div class="visualizing-container-head-right-text-box">🌤 多云转晴东南风 26~30℃</div>
			</div>
		</div>
	</div>
</template>
<script setup lang="ts">
import { reactive, onMounted, onUnmounted, ref } from 'vue';
import { formatDate } from '/@/utils/formatTime';
const state = reactive({
	time: {
		txt: '',
		fun: 0,
	},
});

// 初始化时间
const initTime = () => {
	state.time.txt = formatDate(new Date(), 'YYYY-mm-dd HH:MM:SS WWW QQQQ ZZZ');
	state.time.fun = window.setInterval(() => {
		state.time.txt = formatDate(new Date(), 'YYYY-mm-dd HH:MM:SS WWW QQQQ ZZZ');
	}, 1000);
};
// 页面加载时
onMounted(async () => {
	initTime();
});
</script>
<style lang="scss" scoped>
.visualizing-container-head {
	height: 60px;
	width: 100%;
	position: reactive;
	display: flex;
	align-items: center;
	color: #ffffff;
	background: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.02));
	z-index: 3;
	.visualizing-container-head-left {
		flex: 1;
		position: relative;
		height: 60px;
		.visualizing-container-head-left-text {
			position: relative;
			z-index: 1;
			font-size: 12px;
			opacity: 0.6;
			width: 93%;
			padding-left: 15px;
			top: 50%;
			transform: translateY(-100%);
			.visualizing-container-head-left-text-box {
				width: 100%;
				position: relative;
				padding-left: 15px;
				&::after {
					content: '';
					height: 20px;
					width: 100%;
					position: absolute;
					background: linear-gradient(to right, rgba(22, 207, 208, 0.1), rgba(22, 207, 208, 0.3));
					top: -1px;
					left: 0;
					transform: skew(30deg);
				}
			}
		}
		&::before,
		&::after {
			content: '';
			height: 3px;
			background: linear-gradient(-90deg, #16cfd0, transparent);
			position: absolute;
			width: 100%;
		}
		&::before {
			top: 1px;
			right: 33px;
			opacity: 0.8;
		}
		&::after {
			top: 41px;
			right: -2px;
		}
	}
	.visualizing-container-head-center {
		height: 60px;
		font-size: 18px;
		text-align: center;
		display: flex;
		flex-direction: column;
		position: relative;
		padding: 0 60px;
		background: radial-gradient(rgba(0, 0, 0, 0.7) 5%, rgba(0, 0, 0, 0.5) 15%, rgba(0, 0, 0, 0.02) 70%);
		.visualizing-container-head-center-box {
			margin: auto;
			position: relative;
			z-index: 1;
			.visualizing-container-head-center-maintitle {
				position: relative;
				&::before,
				&::after {
					content: '';
					position: absolute;
					min-width: 21%;
					height: 29px;
					top: 2px;
					opacity: 0.3;
					border-top: 1px solid #16cfd0;
				}
				&::before {
					left: -70px;
					border-right: 2px solid #16cfd0;
					transform: skew(50deg);
				}
				&::after {
					right: -70px;
					border-left: 2px solid #16cfd0;
					transform: skew(-50deg);
				}
			}
			.visualizing-container-head-center-subtitle {
				font-size: 14px;
				opacity: 0.8;
				position: relative;
				&::before,
				&::after {
					content: '';
					position: absolute;
					min-width: 35%;
					height: 23px;
					bottom: 8px;
					border-bottom: 2px solid #16cfd0;
				}
				&::before {
					transform: skew(50deg);
					left: -33px;
					border-left: 3px solid #16cfd0;
					border-image: linear-gradient(to right, #16cfd0, rgba(22, 207, 208, 0.02)) 1 10;
				}
				&::after {
					transform: skew(-50deg);
					right: -33px;
					border-right: 3px solid #16cfd0;
					border-image: linear-gradient(to left, rgba(22, 207, 208, 1), rgba(22, 207, 208, 0.02)) 1 10;
				}
			}
			&::before,
			&::after {
				content: '';
				position: absolute;
				width: 36px;
				height: 17px;
				top: -8px;
				border-bottom: 2px solid rgba(22, 207, 208, 0.7);
			}
			&::before {
				transform: skew(32deg);
				left: -89px;
				border-left: 3px solid rgba(22, 207, 208, 0.7);
			}
			&::after {
				transform: skew(-32deg);
				right: -89px;
				border-right: 3px solid rgba(22, 207, 208, 0.7);
			}
		}
		&::before,
		&::after {
			content: '';
			position: absolute;
			min-width: 50%;
			height: 15px;
			bottom: 0px;
			border-bottom: 4px solid #16cfd0;
		}
		&::before {
			transform: skew(60deg);
			left: 13px;
			border-left: 5px solid #16cfd0;
		}
		&::after {
			transform: skew(-60deg);
			right: 13px;
			border-right: 5px solid #16cfd0;
		}
	}
	.visualizing-container-head-right {
		flex: 1;
		position: relative;
		height: 60px;
		.visualizing-container-head-right-text {
			position: relative;
			z-index: 1;
			font-size: 12px;
			opacity: 0.6;
			width: 93%;
			float: right;
			text-align: right;
			padding-right: 15px;
			top: 50%;
			transform: translateY(-100%);
			.visualizing-container-head-right-text-box {
				width: 100%;
				position: relative;
				padding-right: 15px;
				&::after {
					content: '';
					height: 20px;
					width: 100%;
					position: absolute;
					background: linear-gradient(to left, rgba(22, 207, 208, 0.1), rgba(22, 207, 208, 0.3));
					top: -1px;
					right: 0;
					transform: skew(-30deg);
				}
			}
		}
		&::before,
		&::after {
			content: '';
			height: 3px;
			background: linear-gradient(90deg, #16cfd0, transparent);
			position: absolute;
			width: 100%;
		}
		&::before {
			top: 1px;
			left: 33px;
			opacity: 0.8;
		}
		&::after {
			top: 41px;
			left: -2px;
		}
	}
}
</style>
